import tkinter as tk
import tkinter.messagebox
from main import *

# 基础弹窗
window = tk.Tk()
window.title('图书馆管理系统管理员登陆界面')
window.geometry('450x300')



#用户登录界面
tk.Label(window, text='管理员用户名: ').place(x=50, y= 150)
tk.Label(window, text='密            码: ').place(x=50, y= 190)
var_usr_name = tk.StringVar()
var_usr_name.set('请输入用户名')
entry_usr_name = tk.Entry(window, textvariable=var_usr_name)
entry_usr_name.place(x=160, y=150)
var_usr_pwd = tk.StringVar()
entry_usr_pwd = tk.Entry(window, textvariable=var_usr_pwd, show='*')
entry_usr_pwd.place(x=160, y=190)

 # 登录方法函数
def usr_login():
    usr_name ='233'
    usr_pwd ='233'
    if entry_usr_pwd.get() == usr_pwd and entry_usr_name.get()== usr_name:
        tkinter.messagebox.showinfo(title='登陆成功', message='欢迎')
        window.destroy()
        mainPage()

    else:
        tkinter.messagebox.showinfo(message='输入有误请重新输入')


# 登录窗口buttion
btn_login = tk.Button(window, text='登陆', command=usr_login)
btn_login.place(x=210, y=230)




window.mainloop()